package com.wh.qos;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConfirmListener;
import com.rabbitmq.client.Connection;
import com.wh.utils.ConnectionUtil;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @Auther: HuiEr
 * @Date: 2020/3/11 14:14
 * @Description
 */
public class Producer {
    private static final String QUEUE_NAME="helloworld_qos_queue";
    public static void main(String[] args) throws IOException, TimeoutException {
        Connection connection = ConnectionUtil.getConnection();
        Channel channel = connection.createChannel();

        channel.queueDeclare(QUEUE_NAME,false,false,false,null);

        for (int i=0;i<100;i++){
            channel.basicPublish("",QUEUE_NAME,null,("helloworld模型的一条消息"+i).getBytes());

        }
    }
}
